package com.jwt.mapper;

import com.jwt.pojo.Role;
import com.jwt.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User findByUsername(String username);

    @Select("select * from user")
    List<User> findAllUsers();

    List<Role> findRolesByUserId(int id); //根据用户id查找角色Role集合，角色中又包含权限

}
